inspector: Drop the class hierarchy page
authorMatthias Clasen <mclasen@redhat.com>
Tue, 2 Apr 2019 21:50:09 +0000 (21:50 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 2 Apr 2019 21:50:09 +0000 (21:50 +0000)
This was just  not useful enough to keep around.

gtk/inspector/init.c
gtk/inspector/meson.build
gtk/inspector/object-hierarchy.c [deleted file]
gtk/inspector/object-hierarchy.h [deleted file]
gtk/inspector/object-hierarchy.ui [deleted file]
gtk/inspector/window.c
gtk/inspector/window.ui

index dd10edb34a78dded0fdb16dca6024ec4d8300648..51360e7c1ca517548fb13688fe8a25ac4b788fe9 100644 (file)
@@ -36,7 +36,6 @@
 #include "magnifier.h"
 #include "menu.h"
 #include "misc-info.h"
-#include "object-hierarchy.h"
 #include "object-tree.h"
 #include "prop-list.h"
 #include "recorder.h"
@@ -71,7 +70,6 @@ gtk_inspector_init (void)
   g_type_ensure (GTK_TYPE_INSPECTOR_MAGNIFIER);
   g_type_ensure (GTK_TYPE_INSPECTOR_MENU);
   g_type_ensure (GTK_TYPE_INSPECTOR_MISC_INFO);
-  g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY);
   g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_TREE);
   g_type_ensure (GTK_TYPE_INSPECTOR_PROP_LIST);
   g_type_ensure (GTK_TYPE_INSPECTOR_RECORDER);
index 35b24c8de7a66eedd2660c50ea008ffef201a437..e0b740783ab5061f85ed21b45c06b782a165dd6c 100644 (file)
@@ -20,7 +20,6 @@ inspector_sources = files(
   'magnifier.c',
   'menu.c',
   'misc-info.c',
-  'object-hierarchy.c',
   'object-tree.c',
   'prop-editor.c',
   'prop-list.c',
diff --git a/gtk/inspector/object-hierarchy.c b/gtk/inspector/object-hierarchy.c
deleted file mode 100644 (file)
index 6acfea4..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2013 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include "config.h"
-#include <glib/gi18n-lib.h>
-
-#include "object-hierarchy.h"
-
-#include "gtktreeselection.h"
-#include "gtktreestore.h"
-#include "gtktreeview.h"
-#include "gtklabel.h"
-
-
-enum
-{
-  COLUMN_OBJECT_NAME
-};
-
-struct _GtkInspectorObjectHierarchyPrivate
-{
-  GtkTreeStore *model;
-  GtkTreeView *tree;
-};
-
-G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorObjectHierarchy, gtk_inspector_object_hierarchy, GTK_TYPE_BOX)
-
-static void
-gtk_inspector_object_hierarchy_init (GtkInspectorObjectHierarchy *oh)
-{
-  oh->priv = gtk_inspector_object_hierarchy_get_instance_private (oh);
-  gtk_widget_init_template (GTK_WIDGET (oh));
-}
-
-static void
-gtk_inspector_object_hierarchy_class_init (GtkInspectorObjectHierarchyClass *klass)
-{
-  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
-  gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/object-hierarchy.ui");
-  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorObjectHierarchy, model);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorObjectHierarchy, tree);
-}
-
-void
-gtk_inspector_object_hierarchy_set_object (GtkInspectorObjectHierarchy *oh,
-                                           GObject                     *object)
-{
-  GType type;
-  const gchar *class_name;
-  GtkTreeIter iter, parent;
-  GList *list = NULL, *l;
-  GHashTable *interfaces;
-  GHashTableIter hit;
-  GType *ifaces;
-  gint i;
-
-  gtk_tree_store_clear (oh->priv->model);
-
-  if (object == NULL)
-    return;
-
-  interfaces = g_hash_table_new (g_str_hash, g_str_equal);
-  type = ((GTypeInstance*)object)->g_class->g_type;
-
-  do
-    {
-      class_name = g_type_name (type);
-      list = g_list_append (list, (gpointer)class_name);
-      ifaces = g_type_interfaces (type, NULL);
-      for (i = 0; ifaces[i]; i++)
-        g_hash_table_add (interfaces, (gchar *)g_type_name (ifaces[i]));
-      g_free (ifaces);
-    }
-  while ((type = g_type_parent (type)));
-
-  if (g_hash_table_size (interfaces) > 0)
-    {
-      gtk_tree_store_append (oh->priv->model, &iter, NULL);
-      gtk_tree_store_set (oh->priv->model, &iter,
-                          COLUMN_OBJECT_NAME, "GInterface",
-                          -1);
-      parent = iter;
-    }
-  g_hash_table_iter_init (&hit, interfaces);
-  while (g_hash_table_iter_next (&hit, (gpointer *)&class_name, NULL))
-    {
-      gtk_tree_store_append (oh->priv->model, &iter, &parent);
-      gtk_tree_store_set (oh->priv->model, &iter,
-                          COLUMN_OBJECT_NAME, class_name,
-                          -1);
-    }
-  g_hash_table_unref (interfaces);
-
-  list = g_list_reverse (list);
-  for (l = list; l; l = l->next)
-    {
-      gtk_tree_store_append (oh->priv->model, &iter, l == list ? NULL : &parent);
-      gtk_tree_store_set (oh->priv->model, &iter,
-                          COLUMN_OBJECT_NAME, l->data,
-                          -1);
-      parent = iter;
-    }
-
-  g_list_free (list);
-
-  gtk_tree_view_expand_all (oh->priv->tree);
-  gtk_tree_selection_select_iter (gtk_tree_view_get_selection (oh->priv->tree), &iter);
-}
-
-// vim: set et sw=2 ts=2:
diff --git a/gtk/inspector/object-hierarchy.h b/gtk/inspector/object-hierarchy.h
deleted file mode 100644 (file)
index 961be2a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef _GTK_INSPECTOR_OBJECT_HIERARCHY_H_
-#define _GTK_INSPECTOR_OBJECT_HIERARCHY_H_
-
-#include <gtk/gtkbox.h>
-
-#define GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY            (gtk_inspector_object_hierarchy_get_type())
-#define GTK_INSPECTOR_OBJECT_HIERARCHY(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY, GtkInspectorObjectHierarchy))
-#define GTK_INSPECTOR_OBJECT_HIERARCHY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY, GtkInspectorObjectHierarchyClass))
-#define GTK_INSPECTOR_IS_OBJECT_HIERARCHY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY))
-#define GTK_INSPECTOR_IS_OBJECT_HIERARCHY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY))
-#define GTK_INSPECTOR_OBJECT_HIERARCHY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY, GtkInspectorObjectHierarchyClass))
-
-
-typedef struct _GtkInspectorObjectHierarchyPrivate GtkInspectorObjectHierarchyPrivate;
-
-typedef struct _GtkInspectorObjectHierarchy
-{
-  GtkBox parent;
-  GtkInspectorObjectHierarchyPrivate *priv;
-} GtkInspectorObjectHierarchy;
-
-typedef struct _GtkInspectorObjectHierarchyClass
-{
-  GtkBoxClass parent;
-} GtkInspectorObjectHierarchyClass;
-
-G_BEGIN_DECLS
-
-GType      gtk_inspector_object_hierarchy_get_type   (void);
-void       gtk_inspector_object_hierarchy_set_object (GtkInspectorObjectHierarchy *oh,
-                                                      GObject                     *object);
-
-G_END_DECLS
-
-#endif // _GTK_INSPECTOR_OBJECT_HIERARCHY_H_
-
-// vim: set et sw=2 ts=2:
diff --git a/gtk/inspector/object-hierarchy.ui b/gtk/inspector/object-hierarchy.ui
deleted file mode 100644 (file)
index c4be430..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<interface domain="gtk40">
-  <object class="GtkTreeStore" id="model">
-    <columns>
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <template class="GtkInspectorObjectHierarchy" parent="GtkBox">
-    <property name="orientation">vertical</property>
-    <child>
-      <object class="GtkScrolledWindow">
-        <property name="hscrollbar-policy">never</property>
-        <property name="expand">1</property>
-        <child>
-          <object class="GtkTreeView" id="tree">
-            <property name="model">model</property>
-            <property name="enable-search">0</property>
-            <property name="headers-visible">0</property>
-            <property name="enable-tree-lines">1</property>
-            <property name="show-expanders">0</property>
-            <property name="level-indentation">18</property>
-            <child internal-child="selection">
-              <object class="GtkTreeSelection">
-                <property name="mode">none</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkTreeViewColumn">
-                <child>
-                  <object class="GtkCellRendererText">
-                    <property name="scale">0.8</property>
-                  </object>
-                  <attributes>
-                    <attribute name="text">0</attribute>
-                  </attributes>
-                </child>
-              </object>
-            </child>
-          </object>
-        </child>
-      </object>
-    </child>
-  </template>
-</interface>
index 716ca2e1e0e4bae095e2bb8a9e59d2219cc9e575..f58261dc074aee972b8993d8b54b258714b17870 100644 (file)
@@ -32,7 +32,6 @@
 #include "controllers.h"
 #include "css-editor.h"
 #include "css-node-tree.h"
-#include "object-hierarchy.h"
 #include "object-tree.h"
 #include "size-groups.h"
 #include "data-list.h"
@@ -71,7 +70,6 @@ set_selected_object (GtkInspectorWindow *iw,
   g_free (title);
 
   gtk_inspector_prop_list_set_object (GTK_INSPECTOR_PROP_LIST (iw->child_prop_list), selected);
-  gtk_inspector_object_hierarchy_set_object (GTK_INSPECTOR_OBJECT_HIERARCHY (iw->object_hierarchy), selected);
   gtk_inspector_misc_info_set_object (GTK_INSPECTOR_MISC_INFO (iw->misc_info), selected);
   gtk_inspector_css_node_tree_set_object (GTK_INSPECTOR_CSS_NODE_TREE (iw->widget_css_node_tree), selected);
   gtk_inspector_size_groups_set_object (GTK_INSPECTOR_SIZE_GROUPS (iw->size_groups), selected);
@@ -318,7 +316,6 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_css_node_tree);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_recorder);
-  gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_hierarchy);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_title);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, size_groups);
   gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, data_list);
index 3a77f55323ee341198038f466fb8eb8bd43b8dc7..bf105b0f487240cc03bf351e820b4e8acdb2b2d6 100644 (file)
                                 </property>
                               </object>
                             </child>
-                            <child>
-                              <object class="GtkStackPage">
-                                <property name="name">hierarchy</property>
-                                <property name="title" translatable="yes">Class Hierarchy</property>
-                                <property name="child">
-                                  <object class="GtkInspectorObjectHierarchy" id="object_hierarchy"/>
-                                </property>
-                              </object>
-                            </child>
                             <child>
                               <object class="GtkStackPage">
                                 <property name="name">css-nodes</property>